package thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();//获取主线程
        System.out.println(main);
        doSome();//主线程调用doSome方法
    }

    public static void doSome(){
        Thread t = Thread.currentThread();//获取调用doSome方法的线程
        System.out.println("运行doSome的方法是:"+t);
        System.out.println("线程的名字:"+t.getName());
        System.out.println("线程的优先级:"+t.getPriority());
        System.out.println("线程是否是守护线程:"+t.isDaemon());
        System.out.println("线程是否是活跃的:"+t.isAlive());
        System.out.println("线程是否是中断的:"+t.isInterrupted());
        System.out.println("线程的唯一标识:"+t.getId());

    }
}
